<template>
	<view class="zuji">
		<view class="zuji_tops">
			<view class="zuji_top">
				<text>收藏列表</text>
			</view>
		</view>
		<u-empty :show='onshou' mode="history" icon="http://cdn.uviewui.com/uview/empty/car.png">
		</u-empty>
		<view class="zuji_list">
			<view class="zuiji_list_data" style=" height: 100%; width: 100%; background-color: #F7F7F7;">
				<view v-for="item in datalist"
					style="background-color: #FFFFFF; min-height: 192px; min-width: 130px; width: 30%;margin: 10px; border-radius: 5px; float: left;">
					<image @click="toxiangqing(item)" style="width: 100%;height: 105px; border-radius: 5px 5px 0 0;"
						:src="item.logo" mode="">
					</image>
					<view style="margin: 5px 0 5px 0; height: 47px; overflow: hidden;">
						<text style="font-size: 13px;">{{item.title}}</text>
					</view>
					<view style="margin: 5px 0 5px 0; ">
						<text style="color: red;">￥</text><text
							style="font-size: 20px; color: red; margin-right: 20%;">{{item.price}}
						</text>
						<text class="iconfont" @click="qx(item.id)"
							style="color: #8d8d46; font-size: 15px;">&#xec7b;</text></text>
					</view>

				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				onshou: true,
				datalist: [],
				lishouc: {
					type: 3,
					page: 1
				},
				del:{
					goodsid:0
				}
			}
		},
		onLoad() {
			this.onlist()
		},
		onShow() {
			this.logd()

		},
		methods: {
			qx(id) {
				var this_ = this
				this.del.goodsid = id
				this.$http.postdelshouc(this.del).then(res => {
					uni.showToast({
						title:res.msg,
						icon: 'none',
					})
					this_.logd()
				})
			},

			onlist() {
				if (this.datalist.length != 0) {
					this.onshou = false
				}
			},
			toxiangqing(item) {

				uni.setStorage({
					key: 'xiangqing',
					data: item
				})

				uni.navigateTo({
					url: "../xiangqing/xiangqing",
				})
			},
			logd() {
				var this_ = this
				this.$http.getaddshouc(this_.lishouc).then(res => {
					this_.datalist = res.data
					if (this_.datalist.length != 0) {
						this_.onshou = false
					}
				})
			}
		}
	}
</script>

<style>
	@font-face {
		font-family: 'iconfont';
		/* Project id 3367375 */
		src: url('//at.alicdn.com/t/font_3367375_jmb67dktxnn.woff2?t=1652153394004') format('woff2'),
			url('//at.alicdn.com/t/font_3367375_jmb67dktxnn.woff?t=1652153394004') format('woff'),
			url('//at.alicdn.com/t/font_3367375_jmb67dktxnn.ttf?t=1652153394004') format('truetype');
	}

	.iconfont {
		font-family: "iconfont" !important;
		font-size: 25px;
		font-style: normal;
		-webkit-font-smoothing: antialiased;
		-webkit-text-stroke-width: 0.2px;
		-moz-osx-font-smoothing: grayscale;
	}

	.zuji {
		width: 100%;
	}

	.zuji_list {
		overflow-y: scroll;
		
			background-color: #F7F7F7;
		padding: 10px;
		width: 100%;
	}

	.zuji_top {
		display: flex;
		justify-content: space-between;
		padding: 0 20px 0 20px;
	}

	.zuji_tops {
		display: flex;
		justify-content: center;
		flex-direction: column;
		background-color: #FFFFFF;
		height: 45px;
		font-size: 13px;
		font-weight: 400;
	}
</style>
